﻿
@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<form id="form1">
    <div style="margin-top: 10px; margin-left: 10px; margin-right: 53px;">
        <input type="hidden" id="Id" name="Id" />
        <div style="padding-top: 20px; margin-right: 30px;">
            <table class="form">
                <tr>
                    <th class="formTitle"><span class="required">*</span>名称：</th>
                    <td class="formValue">
                        <input id="Name" name="Name" type="text" class="form-control required" placeholder="" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle" style="vertical-align:top;"><span class="required">*</span>Url：</th>
                    <td class="formValue">
                        <input id="Host" name="Host" type="text" class="form-control required" placeholder="" />
                        <br/>
                        如：http://59.80.30.157:20101/
                    </td>
                </tr>
                <tr>
                    <th class="formTitle" style="height: 35px;">选项：</th>
                    <td class="formValue" style="padding-top: 1px;">
                        <div class="ckbox">
                            <input id="zt" name="zt" type="checkbox" checked="checked"><label for="zt">有效</label>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>

<script>
    var keyValue = $.request("keyValue");
    $(function () {
        initControl();
        if (!!keyValue) {
            $.najax({
                url: "/Sys/Application/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
    });
    function initControl() {

    }
    function submitForm() {
        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/Sys/Application/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function () {
                $.currentWindow().$("#gridList").resetSelection();
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        })
    }
</script>